﻿// <copyright file="IXmlHandler.cs" company="Snowman Consulting">
//     Copyright (c) 2009 Snowman Consulting. All rights reserved.
// </copyright>

namespace SnowmanConsulting.ProductKeyManager.Xml
{
    using System;
    using System.Xml.Linq;
    using SnowmanConsulting.ProductKeyManager.Data;

    /// <summary>
    /// Interface for Xml Handlers
    /// </summary>
    public interface IXmlHandler
    {
        /// <summary>
        /// Gets the Products imported from the XML.
        /// </summary>
        /// <value>The Products.</value>
        ProductCollection Products { get; }

        /// <summary>
        /// Gets the XML generated by from the Products.
        /// </summary>
        /// <value>The generated XML.</value>
        string GeneratedXml { get; }

        /// <summary>
        /// Loads the XML from a file.
        /// </summary>
        /// <param name="fileUri">The file URI.</param>
        void Load(Uri fileUri);

        /// <summary>
        /// Loads the XML from a string
        /// </summary>
        /// <param name="xml">The XML document as a string.</param>
        void Load(string xml);

        /// <summary>
        /// Loads the XML from an XDocument object.
        /// </summary>
        /// <param name="xmlDocument">The XML document.</param>
        void Load(XDocument xmlDocument);

        /// <summary>
        /// Generates the XML.
        /// </summary>
        /// <param name="productCollection">The products.</param>
        void GenerateXml(ProductCollection productCollection);

        /// <summary>
        /// Generates the XML.
        /// </summary>
        /// <param name="productCollection">The Products.</param>
        /// <param name="generateStyleSheet">if set to <c>true</c> the stylesheet is generated.</param>
        /// <param name="fileName">Name of the file.</param>
        void GenerateXml(ProductCollection productCollection, bool generateStyleSheet, string fileName);
    }
}
